package com.example.mapper;

import com.example.entity.Goods;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsMapper {

    @Insert("insert into goods (name, img, price, supplier_id, category_id, count) values (#{name}, #{img}, #{price}, #{supplierId}, #{categoryId}, #{count})")
    void insert(Goods goods);

//    @Select("select * from goods")
    List<Goods> selectAll(Goods goods);

    void updateById(Goods goods);

    @Delete("delete from goods where id = #{id}")
    void deleteById(Integer id);
}
